/*
 * @Description: 扑克牌
 * @Author: rendc
 * @Date: 2025-08-15 09:53:56
 * @LastEditors: rendc
 * @LastEditTime: 2025-08-15 11:02:30
 */

public class Card {
  // 生成54张扑克牌（13个数字*4种花色，再加大小王2张）
  // 数字
  private String number;
  // 花色
  private String color;
  // 权重
  private int weight;

  // 自动生成
  // 构造器
  public Card() {

  }

  public Card(String number, String color, int weight) {
    this.number = number;
    this.color = color;
    this.weight = weight;
  }

  // get、set
  public String getNumber() {
    return number;
  }

  public void setNumber(String number) {
    this.number = number;
  }

  public String getColor() {
    return color;
  }

  public void setColor(String color) {
    this.color = color;
  }

  public int getWeight() {
    return weight;
  }

  public void setWeight(int weight) {
    this.weight = weight;
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((number == null) ? 0 : number.hashCode());
    result = prime * result + ((color == null) ? 0 : color.hashCode());
    result = prime * result + weight;
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    Card other = (Card) obj;
    if (number == null) {
      if (other.number != null)
        return false;
    } else if (!number.equals(other.number))
      return false;
    if (color == null) {
      if (other.color != null)
        return false;
    } else if (!color.equals(other.color))
      return false;
    if (weight != other.weight)
      return false;
    return true;
  }

  @Override
  public String toString() {
    return "\nCard [number=" + number + ", color=" + color + ", weight=" + weight + "]";
  }

}